import javax.swing.*;
import java.awt.*;

 class CheckboxExample {
    public static void main(String[] args) {
        JFrame frame = new JFrame("Checkbox Example");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(600, 600);
        frame.setLocation(400, 400);
        JPanel panel = new JPanel();

        JCheckBox checkBox1 = new JCheckBox("选项1");
        checkBox1.setPreferredSize(new Dimension(20, 20)); // 设置多选按钮的大小

        JCheckBox checkBox2 = new JCheckBox("选项2");
        checkBox2.setPreferredSize(new Dimension(20, 20));

        panel.add(checkBox1);
        panel.add(checkBox2);

        frame.add(panel);
        frame.pack();
        frame.setVisible(true);
    }
}
